package com.micro.ai.template.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 模板分享实体
 *
 * @author micro-ai
 * @since 0.0.1
 */
@Data
@TableName("template_shares")
@Schema(description = "模板分享实体")
public class TemplateShare {

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @Schema(description = "主键ID")
    private String id;

    @TableField("template_id")
    @Schema(description = "模板ID")
    private String templateId;

    @TableField("tenant_id")
    @Schema(description = "所属租户ID")
    private String tenantId;

    @TableField("user_id")
    @Schema(description = "分享用户ID")
    private String userId;

    @TableField("share_code")
    @Schema(description = "分享码", example = "SHARE12345")
    private String shareCode;

    @TableField("share_type")
    @Schema(description = "分享类型", allowableValues = {"PUBLIC", "PRIVATE", "PASSWORD"})
    private String shareType;

    @TableField("password")
    @Schema(description = "分享密码")
    private String password;

    @TableField("expire_at")
    @Schema(description = "过期时间")
    private LocalDateTime expireAt;

    @TableField("view_count")
    @Schema(description = "查看次数")
    private Integer viewCount;

    @TableField("max_views")
    @Schema(description = "最大查看次数(0=无限制)")
    private Integer maxViews;

    @TableField("created_at")
    @Schema(description = "创建时间")
    private LocalDateTime createdAt;
}

